####################################################
## Study military and education treatments ##
#need plotrix
####################################################
library("plotrix", lib.loc="F:/R/R-2.15.0/library")
x <- c(1.05, 1.2, 1.35, 1.5, 1.65, 1.8) #where the x axis points are
y <- c(-.0522, 0.1505, 2.4599, -.1319, -.8036, 2.0407) #gen,~mil & mil treat, mil treat& mil, educ
se <- c(.29, .4201, .3843, .2969, .5955, .4657)
#Fall miller + 
uiw <- 1.96*se
#porkc, military, military*pork interaction 
par(mar = c(1,4,1,2))
plotCI(x, y, uiw, ylim = c(-3, 4), xlim = c(1, 2.05), axes=F, family="serif",
       ylab=("Change in Support for Sen. Rubio (FL)"), family="serif",  main=(""), 
       pch=c(2, 2, 17, 21, 21, 19, 0, 15, 0, 15)) 
text(1.2, 3.5, "Sen. Rubio\nMilitary Affiliation", family="serif",) 
text(1.65, 3.5, "Sen. Rubio\nNational Defense Importance", family="serif",)

#now the lower labels
text(1.05, -2.4, "General\nTreatment", cex=.8, family="serif",)
text(1.2, -2.4, "Military\nTreatment,\nNot in Mil.", cex=.8, family="serif",)
text(1.35, -2.4, "Military\nTreatment,\nIn in Mil.", cex=.8, family="serif",)
text(1.5, -2.4, "General\nTreatment", cex=.8, family="serif",)
text(1.65, -2.4, "Military Treat.,\nNot Supporting\n Defense", cex=.8, family="serif",)
text(1.8, -2.4, "Military Treat.,\nSupporting\nDefense", cex=.8, family="serif",)

abline(h=0) # the control line
#abline(v=.5)
axis(side=2) #where the y axis is
text( 1, -3, adj=0, family="serif","Note: estimates represent the marginal treatment effect on support for the indicated Member with 95% confidence intervals.
Solid symbols are statistically significant at the p<0.05 level, two-tailed. Sen. Rubio Treatment N=161 for both conditions.", 
      cex=.7)
segments(1.45, -1.5, 1.45, 3.5, lty=3) #this is the bisection line
#segments(1.65, -.8, 1.65, 2, lty=3) #this is the bisection line

#,  adj=c(-.2,1)